home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Steal This CD
/
steal_this_cd.iso
/
Chapter 20 - Adware and Spyware
/
enough.exe
/
inst-but.bat
< prev
next >
Wrap
DOS Batch File
|
2002-04-14
|
11KB
|
465 lines
@echo off
cls
:: Installer for IE Power Tweaks WebZone Accessory and Toolbar Buttons
::
:: Created by Eric L. Howes
:: eburger68@myrealbox.com
:: http://www.staff.uiuc.edu/~ehowes/
::
:: Copyright (c) 2000-2002 Eric L. Howes
::
:: This program is free software; you can redistribute it and/or modify it under
:: the terms of the GNU General Public License as published by the Free Software
:: Foundation; either version 2, or (at your option) any later version.
::
:: This program is distributed in the hope that it will be useful, but WITHOUT ANY
:: WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
:: A PARTICULAR PURPOSE. See the GNU General Public License for more details.
::
:: Some files distributed with this package may not be covered by the GNU GPL. Those
:: files remain the property of their original owners and are covered by the licenses
:: under which they were originally distributed.
::
:: All trademarks are the property of their respective owners.
::
:: You should have received a copy of the GNU General Public License along with this
:: program; see the file COPYING. If not, write to the Free Software Foundation,
:: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
:: Check for NT or 9x
if exist %WINDIR%\SYSTEM32\CONFIG goto prep-nt
:: ---------------
:: Copy choice.com
:: ---------------
:prep-9x
if exist %WINDIR%\command\choice.com goto MENU
if exist %WINDIR%\choice.com goto MENU
copy choice\choice.com %WINDIR%
goto MENU
:: ---------------
:: Copy choice.exe
:: ---------------
:prep-nt
if exist %WINDIR%\command\choice.exe goto MENU
if exist %WINDIR%\choice.exe goto MENU
copy choice\choice.exe %WINDIR%
goto MENU
::********************************************************************
:MENU
::********************************************************************
cls
:: -------------------------------
:: Give the main menu with choices
:: -------------------------------
echo ---------------------------------
echo Installer for
echo.
echo IE Power Tweaks WebZone Accessory
echo.
echo and Toolbar Buttons
echo ---------------------------------
echo.
echo ** Main Menu **
echo.
echo.
echo [1] INSTALL (complete or just buttons)
echo.
echo [2] REMOVE (complete or just buttons)
echo.
echo [3] Exit
echo.
:: ----------
:: Get choice
:: ----------
echo What do you want to do?
choice /c:1234 /n /t:4,90
if errorlevel 4 goto MENU
if errorlevel 3 goto FIN
if errorlevel 2 goto UNINST
if errorlevel 1 goto INSTALL
goto MENU
::********************************************************************
:INSTALL
::********************************************************************
cls
:: ---------------
:: Confirm Install
:: ---------------
echo.
echo ** INSTALL MENU **
echo.
echo.
echo What would you like to install?
echo.
echo [1] IE Power Tweaks WebZone Accessory and Buttons
echo [2] Buttons only (Power Tweaks is already installed)
echo [3] Nothing - return to main menu
choice /c:1234 /n /t:4,90
if errorlevel 4 goto INSTALL
if errorlevel 3 goto MENU
if errorlevel 2 goto GO-BUTT
if errorlevel 1 goto GO-COMP
goto INSTALL
::------
:GO-COMP
::------
:: check for previous install of WebZone
if exist %WINDIR%\SYSTEM\webzone.dll goto PROC-BUTT
if exist %WINDIR%\SYSTEM32\webzone.dll goto PROC-BUTT
:: install WebZone and buttons
start /w RunDll32 advpack.dll,LaunchINFSection webzone\webzone.inf, DefaultInstall
:: confirm installation
if exist %WINDIR%\SYSTEM\webzone.dll goto SUCCESS
if exist %WINDIR%\SYSTEM32\webzone.dll goto SUCCESS
goto ERROR
::------
:GO-BUTT
::------
:: check for previous install of WebZone
if exist %WINDIR%\SYSTEM\webzone.dll goto PROC-BUTT
if exist %WINDIR%\SYSTEM32\webzone.dll goto PROC-BUTT
goto NO-WA
:PROC-BUTT
if exist %WINDIR%\SYSTEM32\config goto BUTT-NT
:: install Buttons on 9x-Me
copy webzone\TSGRAY.ICO %WINDIR%\SYSTEM
copy webzone\RSGRAY.ICO %WINDIR%\SYSTEM
copy webzone\TSCOLOR.ICO %WINDIR%\SYSTEM
copy webzone\RSCOLOR.ICO %WINDIR%\SYSTEM
start /w regedit.exe /s webzone\zb-9x.reg
goto SUCC-2
:BUTT-NT
:: install Buttons on NT-2K-XP
copy webzone\TSGRAY.ICO %WINDIR%\SYSTEM32
copy webzone\RSGRAY.ICO %WINDIR%\SYSTEM32
copy webzone\TSCOLOR.ICO %WINDIR%\SYSTEM32
copy webzone\RSCOLOR.ICO %WINDIR%\SYSTEM32
start /w regedit.exe /s webzone\zb-nt.reg
goto SUCC-2
::********************************************************************
:UNINST
::********************************************************************
cls
:: -----------------
:: Confirm Uninstall
:: -----------------
echo.
echo ** UNINSTALL MENU **
echo.
echo.
echo What would you like to uninstall?
echo.
echo [1] IE Power Tweaks Web Accessories and Buttons
echo [2] Buttons only (leave Power Tweaks)
echo [3] Nothing - return to main menu
choice /c:1234 /n /t:4,90
if errorlevel 4 goto UNINST
if errorlevel 3 goto MENU
if errorlevel 2 goto UN-BUTT
if errorlevel 1 goto UN-COMP
goto UNINST
::------
:UN-COMP
::------
:: check for install of PowerTweaks WebAccessories
start /w regedit /e ie5wa.reg HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\IE5WA
if exist ie5wa.reg goto IE5WA
:: check for previous install of WebZone
if exist %WINDIR%\SYSTEM\webzone.dll goto REM-ALL
if exist %WINDIR%\SYSTEM32\webzone.dll goto REM-ALL
goto NO-PT
:REM-ALL
:: uninstall WebZone and buttons
start /w RunDll32 advpack.dll,LaunchINFSection %WINDIR%\inf\webzone.inf, Uninstall
:: confirm uninstallation
if exist %WINDIR%\SYSTEM\webzone.dll goto ERROR
if exist %WINDIR%\SYSTEM32\webzone.dll goto ERROR
goto SUCC-3
::------
:UN-BUTT
::------
:: check for previous install of WebZone
if exist %WINDIR%\SYSTEM\TSGRAY.ICO goto REM-BUTT
if exist %WINDIR%\SYSTEM32\TSGRAY.ICO goto REM-BUTT
goto NO-BUTT
:REM-BUTT
if exist %WINDIR%\SYSTEM32\config goto RMV-NT
:: uninstall Buttons on 9x-Me
start /w regedit.exe /s webzone\zb-rem.reg
del %WINDIR%\SYSTEM\TSGRAY.ICO
del %WINDIR%\SYSTEM\RSGRAY.ICO
del %WINDIR%\SYSTEM\TSCOLOR.ICO
del %WINDIR%\SYSTEM\RSCOLOR.ICO
goto SUCC-4
:RMV-NT
:: uninstall Buttons on NT-2K-XP
start /w regedit.exe /s webzone\zb-rem.reg
del %WINDIR%\SYSTEM32\TSGRAY.ICO
del %WINDIR%\SYSTEM32\RSGRAY.ICO
del %WINDIR%\SYSTEM32\TSCOLOR.ICO
del %WINDIR%\SYSTEM32\RSCOLOR.ICO
goto SUCC-4
::********************************************************************
:NO-PT
::********************************************************************
cls
echo.
echo.
echo Sorry, but Power Tweaks Web Accessories doesn't appear
echo to be installed on this computer.
echo.
echo.
pause
goto RETURN
::********************************************************************
:NO-BUTT
::********************************************************************
cls
echo.
echo.
echo Sorry, but the zone buttons don't appear
echo to be installed on this computer.
echo.
echo.
pause
goto RETURN
::********************************************************************
:NO-WA
::********************************************************************
cls
echo.
echo.
echo Sorry, but Power Tweaks Web Accessories doesn't appear
echo to be installed on this computer. Please install it
echo before trying to install the buttons.
echo.
echo Hint: you can choose Option 1 from the Install Menu
echo and install both at the same time.
echo.
echo.
pause
goto RETURN
::********************************************************************
:IE5WA
::********************************************************************
cls
echo.
echo.
echo WebZone was NOT uninstalled because IE5 Power Tweaks
echo Web Accessories is installed on this computer. If you
echo wish to uninstall WebZone, uninstall the IE5 Power Tweaks
echo Web Accessories through Add-Remove Programs in the
echo Control Panel. Then return to this utility to completely
echo remove the buttons.
echo.
pause
del ie5wa.reg>nul
goto MENU
::********************************************************************
:ERROR
::********************************************************************
cls
echo.
echo.
echo An error ocurred while performing this task...
echo.
echo.
pause
goto RETURN
::********************************************************************
:SUCCESS
::********************************************************************
cls
echo.
echo.
echo SUCCESS!!
echo.
echo The PowerTweaks WebAccesory and Toolbar buttons
echo have been installed on this computer.
echo.
goto RETURN
::********************************************************************
:SUCC-2
::********************************************************************
cls
echo.
echo.
echo SUCCESS!!
echo.
echo The IE Toolbar buttons have been installed on this computer.
echo.
goto RETURN
::********************************************************************
:SUCC-3
::********************************************************************
cls
echo.
echo.
echo SUCCESS!!
echo.
echo The PowerTweaks WebAccesory and Toolbar buttons
echo have been removed from this computer.
echo.
goto RETURN
::********************************************************************
:SUCC-4
::********************************************************************
cls
echo.
echo.
echo SUCCESS!!
echo.
echo The IE Toolbar buttons have been removed from this computer.
echo.
goto RETURN
::********************************************************************
:RETURN
::********************************************************************
:: -----------------
:: Give Choice Again
:: -----------------
echo.
echo What do you want to do now?
echo.
echo [1] Return to Main Menu
echo [2] Exit
echo.
choice /c:123 /n /t:3,90
if errorlevel 3 goto menu
if errorlevel 2 goto fin
if errorlevel 1 goto menu
::********************************************************************
:FIN
::********************************************************************
:: Delete previous check.reg
if exist check.reg del check.reg>nul
cls
echo.
echo.
echo Bye for now...
echo.
echo.